package com.hellomsg.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * Created by mjitech on 2017/6/28.
 */
@Controller
@RequestMapping(value = "urlTest")
public class URLTestController {
    @RequestMapping(value = "test", produces = "application/json;charset=UTF-8")
    public @ResponseBody String test(@RequestParam Map<String, String> params,
                                     HttpServletRequest request, HttpServletResponse response) {
        Class clazz = request.getClass();
        System.out.println(params);
        System.out.println(request.getParameterMap().size());
        System.out.println(request.getPathTranslated());
        System.out.println(request.getQueryString());
        return "";
    }
}
